package com.lxk.map.gd.api;

import com.dtflys.forest.annotation.Address;
import com.dtflys.forest.annotation.BaseRequest;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Query;
import com.lxk.map.gd.config.GdAddressSource;
import com.lxk.map.gd.config.GdInterceptor;
import com.lxk.map.gd.model.*;
import com.lxk.map.request.GdDistrictQueryRequest;
import com.lxk.map.result.GdAreaResult;

/**
 * @author heyi
 * 2024/8/5
 */
@Address(source = GdAddressSource.class)
@BaseRequest(interceptor = {GdInterceptor.class})
public interface GdApi {

    /**
     * 地理编码 API 服务地址
     * https://lbs.amap.com/api/webservice/guide/api/georegeo/
     *
     * @param req
     * @return
     */
    @Get("/geocode/geo")
    GdGeoResp geo(@Query GeoAddressReq req);

    /**
     * 逆地理编码 API 服务地址
     * https://restapi.amap.com/v3/geocode/regeo?parameters
     *
     * @param req
     */
    @Get("/geocode/regeo")
    GdReGeoResp reGeo(@Query GdReGeoReq req);

    /**
     * 行政区域查询 API
     * https://restapi.amap.com/v3/config/district?parameters
     *
     * @param req
     * @return
     */
    @Get("/config/district")
    GdAreaResult queryGdArea(@Query GdDistrictQueryRequest req);

    /**
     * 根据 IP 地址查询城市信息
     * https://restapi.amap.com/v3/ip?parameters
     *
     * @param req
     * @return
     */
    @Get("/ip")
    GdIpResp queryCityByIp(@Query GdIpReq req);

    /**
     * 坐标转换
     * https://restapi.amap.com/v3/assistant/coordinate/convert?parameters
     *
     * @param req
     * @return
     */
    @Get("/assistant/coordinate/convert")
    GdTransformResp transform(@Query GdTransformReq req);

    /**
     * 静态地图
     * https://restapi.amap.com/v3/staticmap?parameters
     *
     * @param req
     * @return
     */
    @Get("/staticmap")
    String queryStaticMap(@Query GdStaticMapReq req);
}
